package com.leyou.item.mapper;

import com.leyou.item.pojo.Spu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

public interface SpuMapper extends Mapper<Spu> {

    /**
     * 根据spuId修改商品上下架状态
     * @param spuId
     * @param saleable  上下架状态
     * @return
     */
    @Update("UPDATE tb_spu SET saleable = #{saleable} WHERE id = #{spuId}")
    int updateGoodStatus(@Param("spuId") Long spuId, @Param("saleable") Integer saleable);
}
